package dbreflection.dbanalisys;

import java.util.HashMap;

/**
 * User: J0k3r
 * Date: 14.12.2006
 * Time: 9:15:28
 */
public class DBTable
{
    private String tableName;
    private HashMap<String , DBTableColumn> columns = new HashMap<String, DBTableColumn>();
    private String tableCaption = "";

    public DBTable(String tableName, String tableCaption, HashMap<String, DBTableColumn> columns)
    {
        this.tableName = tableName;
        if (columns != null)
            this.columns = columns;
        this.tableCaption = tableCaption;
    }

    public void addColumn(DBTableColumn column)
    {
        columns.put(column.getColumnName(), column);
    }

    public DBTableColumn getColumn(String tableName)
    {
        return columns.get(tableName);
    }

    public String getTableName()
    {
        return tableName;
    }

    public HashMap<String, DBTableColumn> getColumns()
    {
        return columns;
    }

    public String getTableCaption()
    {
        return tableCaption;
    }
}
